package com.cncytech.uiautomator_demo.testcase;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.is;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.utils.Describe;

import org.junit.Rule;
import org.junit.Test;

public class PeripheralPoliciesTest extends BaseTest {

    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);

    @Test
    @Describe(TestConstant.PERIPHERAL_FORBIDDEN)
    public void peripheralForbiddenTest() {
        String msg = TestConstant.PERIPHERAL_FORBIDDEN + TestConstant.FAILURE;
        int status = 0;
        assertThat(msg,hmm.setPeripheralPolicies(status));
        int peripheralPolicies = hmm.getPeripheralPolicies();
        assertThat(msg,peripheralPolicies,is(status));
    }

    @Test
    @Describe(TestConstant.PERIPHERAL_ENABLE)
    public void peripheralEnableTest() {
        String msg = TestConstant.PERIPHERAL_FORBIDDEN + TestConstant.FAILURE;
        int status = 1;
        assertThat(msg,hmm.setPeripheralPolicies(status));
        int peripheralPolicies = hmm.getPeripheralPolicies();
        assertThat(msg,peripheralPolicies,is(status));
    }
}
